package com.mmall.concurrency.publishDemo;

import com.mmall.concurrency.annotations.NotRecommend;
import com.mmall.concurrency.annotations.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;

/**
 * 线程溢出
 */
@Slf4j
@NotThreadSafe
@NotRecommend
public class Escape {
    private int thisCanBeEscape = 0;

    public Escape(){
        new InnerClass();
    }
    //内部类
    public class InnerClass {
        public InnerClass(){
            log.info("{}", Escape.this.thisCanBeEscape);
        }
    }

    //主方法测试
    public static void main(String[] args){
        new Escape();
    }
}
